package com.yz.design.responsibilityDegin;


public abstract class AbstractMessageHandler<T, R> extends AbstractCommonListener {
    /**
     * 下一个责任链成员
     */
    protected AbstractMessageHandler<T, R> nextHandler;

    public AbstractMessageHandler getNextHandler() {
        return nextHandler;
    }

    public void setNextHandler(AbstractMessageHandler<T, R> nextHandler) {
        this.nextHandler = nextHandler;
    }

    /**
     * 处理传递过来的tag
     *
     * @param message 表达式
     * @return T
     */
    public abstract T handleMessage(R message);

}